package designpatterns.factory;

import java.util.function.Supplier;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 2022/1/23 13:26
 */
public enum CarType {

    BAOMA(BaoMa::new),
    HONGQI(HongQi::new);

    CarType(Supplier<Car> constructor) {
        this.constructor = constructor;
    }

    private final Supplier<Car> constructor;

    public Supplier<Car> getConstructor() {
        return constructor;
    }
}
